package com.woniu.his.app.app.apiImpl;

import cn.hutool.core.bean.BeanUtil;
import com.woniu.his.app.client.AppRegistrationTimeQuantumClient;
import com.woniu.his.app.client.param.AddRegistrationTimeQuantumParam;
import com.woniu.his.app.service.service.RegistrationTimeQuantumService;
import com.woniu.his.app.service.service.param.AddRegistrationTimeServiceQuantumParam;
import com.woniu.his.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/app")
@Slf4j
public class AppRegistrationTimeQuantumApiImpl implements AppRegistrationTimeQuantumClient {

    @Resource
    private RegistrationTimeQuantumService registrationTimeQuantumService;

    @Override
    public Result addRegistrationTimeQuantum(AddRegistrationTimeQuantumParam param) {

        log.info("增加时间段的参数为：{}",param);
        AddRegistrationTimeServiceQuantumParam serviceParam= BeanUtil.copyProperties(param,AddRegistrationTimeServiceQuantumParam.class);
        registrationTimeQuantumService.addRegistrationTimeQuantum(serviceParam);
        return Result.getInstance();
    }
}
